package com.example.ixform.services;


import com.example.ixform.dao.IdolRepository;
import com.example.ixform.entities.Idol;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class IdolService {

    @Autowired

    IdolRepository idolRepository;

    public Idol save(Idol idol){
        return idolRepository.save(idol);
    }
    public  List<Idol> getAll(){
        return idolRepository.findAll();
    }

    public Idol findByIdolId(long theId) {

        return idolRepository.findByIdolId(theId);
    }

    public void delete(Idol idol) {

        idolRepository.delete(idol);
    }
}
